package com.ymttest.database.sqlwapper.godmch;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.mch_info;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/************************************************************************************
 * @Author : 吴文
 * @Date : 
 * @Copyright : 洋码头
 *godmach
 ************************************************************************************/
public class mch_infoWapper {
    SqlManager manage;

    public mch_infoWapper() {
        manage = new SqlManager("mysqlgodmchdb" + EnvSetup.getEnv());

    }

    public List<mch_info> selectby(Map<String, Object> map) throws InterruptedException {

        List<mch_info> list = (List<mch_info>) manage.getSelectResults("com.ymttest.database.mapping.godmch.mch_infoMapper.selectby", map);
        manage.commit();
        return list;
    }

    public int selectCount(Map<String, Object> map) throws InterruptedException {

        int count = (int) manage.getSelectResults("com.ymttest.database.mapping.godmch.mch_infoMapper.selectCount", map).get(0);
        manage.commit();
        return count;
    }

    public int updateByPrimaryKey(mch_info record) {
        int result = manage.update("com.ymttest.database.mapping.godmch.mch_infoMapper.updateByPrimaryKey", record);
        manage.commit();
        return result;
    }


    public List<mch_info> selectbyMchIds(List<Integer> mchIds) {
        List<mch_info> result = manage.getSelectResults("com.ymttest.database.mapping.godmch.mch_infoMapper.selectbyMchIds", mchIds);
        manage.commit();
        return result;
    }

    public int updateProductBorderProperty(int mchId) {

        int result = manage.update("com.ymttest.database.mapping.godmch.mch_infoMapper.updateProductBorderProperty", mchId);
        manage.commit();
        return result;
    }

    public static void main(String args[]) throws InterruptedException {
        mch_infoWapper wapper = new mch_infoWapper();
        System.out.print(wapper.updateProductBorderProperty(510017265));
    }
}
